package com.jyw.business.obstacles.controller;


import com.jyw.business.obstacles.domain.dto.web.OrderAllPageDto;
import com.jyw.business.obstacles.domain.dto.web.ServerCallPageDto;
import com.jyw.business.obstacles.domain.dto.web.ServerPageDto;
import com.jyw.business.obstacles.domain.vo.web.OrderAllPageVO;
import com.jyw.business.obstacles.domain.vo.web.ServerCallPageVO;
import com.jyw.business.obstacles.domain.vo.web.ServerPageVO;
import com.jyw.business.obstacles.service.IObsOrderInfoService;
import com.jyw.common.core.controller.BaseController;
import com.jyw.common.core.page.BasePage;
import com.jyw.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "工单代办")
@RestController
@RequestMapping("/obstacles/agent")
public class ObsAgentController extends BaseController {

    @Resource
    private IObsOrderInfoService obsOrderInfoService;

    @PostMapping("/waitDispatch")
    @ApiOperation("分页查询 待报修工单-待派单")
    public TableDataInfo<ServerPageVO> getWaitDispatch(@RequestBody ServerPageDto pageDto,BasePage page) {
        List<ServerPageVO> list = obsOrderInfoService.getWaitDispatch(pageDto,page);
        return getDataTable(list);
    }


    @PostMapping("/waitCreate")
    @ApiOperation("分页查询 待报修工单-待建单")
    public TableDataInfo<ServerCallPageVO> getWaitCreate(@RequestBody ServerCallPageDto pageDto, BasePage page) {
        List<ServerCallPageVO> list = obsOrderInfoService.getWaitCreate(pageDto,page);
        return getDataTable(list);
    }

    @PostMapping("/handleRepair")
    @ApiOperation("分页查询 待处理工单")
    public TableDataInfo<OrderAllPageVO> getWaitHandleList(@RequestBody OrderAllPageDto dto) {
        List<OrderAllPageVO> list = obsOrderInfoService.getWaitHandleList(dto);
        return getDataTable(list);
    }


}
